package com.ruoyi.activiti.bpmnparse.x6translator;

import com.ruoyi.activiti.bpmnparse.Translator;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class EndEventTranslator extends Translator {
    private List<Map<String,Object>> x6ListMap;
    private String type = "endEvent";
    public EndEventTranslator(List<Map<String,Object>> x6ListMap){
        this.x6ListMap = x6ListMap;
    }
    @Override
    public Map<String, Object> translate(Map<String, Object> sourceMap) {
        Map<String, Object> dataMap = (Map<String, Object>) sourceMap.get("data");
        Map<String, Object> bpmnMap = new HashMap<>();
        String id = (String) dataMap.get("id");
        String name = (String) dataMap.get("label");
        bpmnMap.put(Translator.BPMN_ID,id);
        bpmnMap.put(Translator.BPMN_TYPE,type);
        bpmnMap.put(Translator.BPMN_NAME,name);
        return bpmnMap;
    }

    @Override
    public String getTaskType() {
        return type;
    }
}
